import { IsString, IsNotEmpty } from 'class-validator'
import { ApiProperty } from '@nestjs/swagger'

export class LoginUserDto {
  @ApiProperty({
    description: '用户名',
    uniqueItems: true,
    example: 'admin',
  })
  @IsString({ message: '不是有效数据' })
  @IsNotEmpty({ message: '用户名不能为空' })
  readonly username: string

  @ApiProperty({
    description: '密码',
    uniqueItems: true,
    example: 'admin',
  })
  @IsString({ message: '不是有效的数据' })
  @IsNotEmpty({ message: '密码不能为空' })
  readonly password: string
}
